﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using ABC.Business.Models;
using ABC.Core.Configuration;
using ABC.Domain.Entities;

namespace ABC.Controllers.ViewModels.My
{
    public class MyOrderBsoViewModel : BaseViewModel
    {
        public string ProductId { get; set; }

        public string CompanyId { get; set; }

        public string Quantity { get; set; }

        public List<SelectListItem> ListForCompany { get; set; }

        public List<SelectListItem> ListForProduct { get; set; }

        public List<SelectListItem> ListForQuantity { get; set; }

        public MyOrderBsoViewModel()
        {
            var rbsCalcModel = IoC.Resolve<RbsCalcModel>();
            var financeModel = IoC.Resolve<FinanceModel>();
            ListForCompany = new List<SelectListItem>();
            ListForQuantity = new List<SelectListItem>
                                {
                                    new SelectListItem { Text = "1", Value = "1" },
                                    new SelectListItem { Text = "2", Value = "2" },
                                    new SelectListItem { Text = "3", Value = "3" },
                                    new SelectListItem { Text = "4", Value = "4" },
                                    new SelectListItem { Text = "5", Value = "5" },
                                    new SelectListItem { Text = "6", Value = "6" },
                                    new SelectListItem { Text = "7", Value = "7" },
                                    new SelectListItem { Text = "8", Value = "8" },
                                    new SelectListItem { Text = "9", Value = "9" },
                                    new SelectListItem { Text = "10", Value = "10" }
                                };
            ListForProduct = financeModel.GetTypesOfInsurance().Select(x => new SelectListItem { Value = x.Key, Text = x.Value }).
                    ToList();
            ListForCompany = rbsCalcModel.GetInsuranceCompanies().Select(x=>new SelectListItem{Value = x.Id,Text = x.Name}).ToList();
        }
    }
}
